<#macro page pageNo totalCount totalPage showPages callFunName>
    <div class='layui-box layui-laypage layui-laypage-default'>
        <div>
            <span class="layui-laypage-count">第${pageNo}页/共${totalPage}页</span>
            <#if pageNo!=1>
                <a href="javascript:${callFunName+'('+1+')'};" class="prev">首页</a>
                <a href="javascript:${callFunName+'('+(pageNo-1)+')'};" class="prev">上一页</a>
            </#if>
            <#if pageNo-showPages/2 gt 0>
                <#assign start = pageNo-(showPages-1)/2/>
                <#if showPages gt totalPage>
                    <#assign start = 1/>
                </#if>
            <#else>
                <#assign start = 1/>
            </#if>
            <#if totalPage gt showPages>
                <#assign end = (start+showPages-1)/>
                <#if end gt totalPage>
                    <#assign start = totalPage-showPages+1/>
                    <#assign end = totalPage/>
                </#if>
            <#else>
                <#assign end = totalPage/>
            </#if>
            <#assign pages=start..end/>
            <#list pages as page>
                <#if page==pageNo>
                    <span class="current" style="color:#fff;background-color:#009688;border:1px solid #009688;">${page}</span>
                <#else>
                    <a class="num" href="javascript:${callFunName+'('+page+')'};">${page} </a>
                </#if>
            </#list>
            <#if pageNo!=totalPage>
                <a href="javascript:${callFunName+'('+(pageNo+1)+')'};" class="next">下一页</a>
                <a href="javascript:${callFunName+'('+totalPage+')'};" class="next">尾页</a>
            </#if>
            <span class="layui-laypage-skip">
                <input type='text' size="4" value="${pageNo}" id="goPage" class="layui-input" min="1"/>
                <a class="layui-laypage-btn" href='javascript:jumpPage()' id='jumpPage'>跳转</a>
            </span>
        </div>
    </div>
    <span style="float: right;">共有数据：${totalCount} 条</span>
    <script type="text/javascript">
        function jumpPage() {
            var currPage = $("#goPage").val();
            if (isNaN(currPage)) {
                alert("输入格式不正确，请重新输入!");
                return;
            }
            if (currPage > ${totalPage}) {
                alert("输入页数大于当前最大页!");
                $("#goPage").val(${totalPage});
                currPage = ${totalPage};
            }
            ${callFunName}(currPage);
        }
        // 分页添加这个脚本
        function showPage(currPage) {
            $("#pageNumber").val(currPage);
            document.forms[0].submit();
        }
    </script>
</#macro>